﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Entidades;
using LogicaNegocio;

namespace LimsWeb.iAdministrador
{
    public partial class Inicio : System.Web.UI.Page
    {
        LN_Laboratorio oLN_Lab = new LN_Laboratorio();
        LN_Empresa oLN_Emp = new LN_Empresa();
        ENT_Empresa oEnt_Emp = new ENT_Empresa();

        List<ENT_Laboratorio> oLista_Lab = new List<ENT_Laboratorio>();


        protected void Page_Load(object sender, EventArgs e)
        {

            string ruc = string.Empty;
            try
            {
                int usuarioID = Int32.Parse(Session["UsuarioID"].ToString());
                 ruc = (Session["RUC"].ToString());
            }
            catch
            {
                Response.Redirect("../iRegistro/Login.aspx");
            }


            if (!IsPostBack)
            {
                oLista_Lab = oLN_Lab.ListarLaboratorioXEmpresa(Int32.Parse(Session["UsuarioID"].ToString()));
                gvLaboratorio.DataSource = oLista_Lab;
                gvLaboratorio.DataBind();

                oEnt_Emp = oLN_Emp.ListarInfoEmpresa(ruc);

                txtRuc.Text = ruc;
                txtRazonSocial.Text = oEnt_Emp.RazonSocial;
                txtNomPais.Text = oEnt_Emp.NomPais;
                txtNomCiudad.Text = oEnt_Emp.NomCiudad;
                txtNomRubro.Text = oEnt_Emp.NomRubro;
                txtDireccion.Text = oEnt_Emp.Direccion;
                txtDom.Text = oEnt_Emp.Dominio;
                txtUso.Text = oEnt_Emp.Servicio.ToString();




            }


        }
    }
}